home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-06 / an102x.zip / GETCONN.ASM < prev    next >
Assembly Source File  |  1991-04-09  |  2KB  |  86 lines

  1. ;*****************************************************************************
  2. ; GETCONN.ASM
  3. ;
  4. ; 90-12-27 Matt Hagen, Novell, Inc.
  5. ;*****************************************************************************
  6.  
  7. ConnIDTable        struc
  8.  InUse            db    ?
  9.  Order            db    ?
  10.  Net            db    4 dup(?)
  11.  Node            db    6 dup(?)
  12.  Socket            db    2 dup(?)
  13.  Timeout        db    2 dup(2)
  14.  ImmedAddr        db    6 dup(?)
  15.  Sequence        db    ?
  16.  ConnectionNum        db    ?
  17.  ConnectionStatus    db    ?
  18.  MaxTimeout        db    2 dup(?)
  19.  Reserved        db    5 dup(?)
  20. ConnIDTable        ends
  21.  
  22. DOSSEG
  23. .MODEL    SMALL
  24. .DATA
  25. .CODE
  26.     public _GetConnectionIDTableEntry
  27.  
  28. ;*****************************************************************************
  29. ; int GetConnectionIDTableEntry(
  30. ;    WORD connID,
  31. ;    ConnIDTable *entry)
  32. ;
  33. ; connID is an index (1..8) into the table.  entry is a pointer to a buffer
  34. ; big enough to hold a ConnIDTable structure.  The routine copies the specified
  35. ; Connection ID Table entry into the buffer.  The routine returns a value of 0
  36. ; for successful and a non-zero value if connID is an invalid number.
  37. ;*****************************************************************************
  38.  
  39. _GetConnectionIDTableEntry    proc
  40.     ARG    connID:WORD, entry:DATAPTR
  41.     push    bp
  42.     mov    bp, sp
  43.     push    si
  44.     push    di
  45.     push    ds
  46.  
  47.     mov    ax, connID
  48.     dec    ax
  49.     cmp    ax, 7
  50.     ja    InvalidIndex
  51.  
  52.     mov    bl, size ConnIDTable
  53.     mul    bl
  54.     mov    bx, ax
  55.  
  56.     mov    ax, 0ef03h
  57.     int    21h
  58.  
  59.     add    si, bx
  60.     mov    bx, es
  61.  
  62. IF    @DataSize EQ 0
  63.     mov    di, entry
  64.     mov    ax, ds
  65.     mov    es, ax
  66. ELSE
  67.     les    di, entry
  68. ENDIF
  69.     mov    ds, bx
  70.     mov    cx, size ConnIDTable
  71.     shr    cx, 1
  72.     rep    movsw
  73.     xor    ax, ax
  74.  
  75. InvalidIndex:
  76.     pop    ds
  77.     pop    di
  78.     pop    si
  79.     pop    bp
  80.     ret
  81. _GetConnectionIDTableEntry    endp
  82.     end
  83.  
  84. ;*****************************************************************************
  85. ;*****************************************************************************
  86.